/**
 * Obsolete.
 * Look @ Bind.js
 * */

function Component(id, element) {
    this.id = id;
    this.element = element;

    return this;
}

//-------------------------------------------------------------------------------------------------

Component.prototype.getValue = function() {
    //element should implements method getValue()
    if (this.element.getValue != null) {
        return this.element.getValue();
    }
    else{
    	if (this.element.type && this.element.type.toLowerCase()=="checkbox"){
    		return this.element.checked;
    	}
    }
    return this.element.value;
};

//-------------------------------------------------------------------------------------------------

Component.prototype.setValue = function(value) {
    //element should implements method setValue()
    if (this.element.setValue != null) {
        this.element.setValue(value);
    } 
    else {
    	if (this.element.type && this.element.type.toLowerCase()=="checkbox"){
    		this.element.checked = value;
    	}
    	this.element.value = value;
    }
};